﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Manager.CustomerHelper
{
    public class CustomMenu : CustomTree, ICloneable
    {

        private string imageUrl;
        private string navigateUrl;
        private bool isShow;
        private int sortIndex;
        private string remark;

        public bool EnablePostback
        {
            get;
            //{
            //    //if (string.IsNullOrEmpty(NavigateUrl))
            //    //    return false;
            //    //else
            //    //    return true;
            //};
            set;
        }
        public string NavigateUrl
        {
            get { return navigateUrl; }
            set { navigateUrl = value; }
        }

        public string ImageUrl
        {
            get { return imageUrl; }
            set { imageUrl = value; }
        }

        public int SortIndex
        {
            get { return sortIndex; }
            set { sortIndex = value; }
        }

        public bool IsShow
        {
            get { return isShow; }
            set { isShow = value; }
        }

        public string Remark
        {
            get { return remark; }
            set { remark = value; }
        }

        public CustomMenu()
        {
        }

        private CustomMenu(CustomMenu menu)
            : base(menu)
        {
            ImageUrl = menu.ImageUrl;
            NavigateUrl = menu.NavigateUrl;
            sortIndex = menu.SortIndex;
            IsShow = menu.IsShow;
            Remark = menu.Remark;
        }



        public object Clone()
        {
            CustomMenu menu = new CustomMenu(this);
            return menu;
        }
    }
    public class CustomDistrict 
    {
        private int sortIndex;
        private string id;
        private string parentId;
        private string name;

        public string Id
        {
            get { return id; }
            set { id = value; }
        }

        public string ParentId
        {
            get { return parentId; }
            set { parentId = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
      
        public int SortIndex
        {
            get { return sortIndex; }
            set { sortIndex = value; }
        }
        /// <summary>
        /// 在模拟树的Grid中使用
        /// </summary>
        private int treeLevel = 0;
        /// <summary>
        /// 是Tree中使用
        /// </summary>
        private bool isTreeLeaf = false;
        /// <summary>
        /// 在模拟树的下拉列表中使用
        /// </summary>
        private bool enabled = true;


        /// <summary>
        /// 本菜单在树形结构中层级（从0开始）
        /// </summary>
        public int TreeLevel
        {
            get { return treeLevel; }
            set { treeLevel = value; }
        }

        /// <summary>
        /// 是否可用（默认true）
        /// </summary>
        public bool Enabled
        {
            get { return enabled; }
            set { enabled = value; }
        }

        /// <summary>
        /// 是否叶子节点（默认false）
        /// </summary>
        public bool IsTreeLeaf
        {
            get { return isTreeLeaf; }
            set { isTreeLeaf = value; }
        }
      

        public CustomDistrict()
        {
        }

        //private CustomDistrict(CustomDistrict menu)
        //    : base(menu)
        //{
        //    ImageUrl = menu.ImageUrl;
        //    NavigateUrl = menu.NavigateUrl;
        //    sortIndex = menu.SortIndex;
        //    IsShow = menu.IsShow;
        //    Remark = menu.Remark;
        //}



        //public object Clone()
        //{
        //    //CustomDistrict menu = new CustomDistrict(this);
        //    //return menu;
        //}
    }
}
